package model

import (
	"WebSupervisor/MyTool"
	"encoding/json"
)

type ConfigModel struct {
	Qqmail QQMail `json:"qqmail"`
}
type QQMail struct {
	UserName string `json:"userName"`
	Password string `json:"password"`
	To       string `json:"To"`
}

func ReadConfig(path string) *ConfigModel {
	if !MyTool.CheckFileExist(path) {
		panic("配置文件不存在")
	}
	js := new(ConfigModel)
	json.Unmarshal([]byte(MyTool.Read(path)), js)
	return js
}
